package com.plan.base.exception;

import com.plan.base.constant.BaseCode;


import java.io.Serializable;

public class BizException extends RuntimeException implements Serializable {

    private static final long serialVersionUID = -6386022267540525005L;
    private final String defaultCode = BaseCode.BIZ_EXCEPTION;
    private String code;
    private Object[] args;
    private Object errorData;

    public BizException() {
        this.code = BaseCode.BIZ_EXCEPTION;
    }

    public BizException(String code) {
        this.code = code;
    }

    public BizException(String code, Object... args) {
        this.code = code;
        this.args = args;
    }

    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Object[] getArgs() {
        return this.args;
    }

    public void setArgs(Object[] args) {
        this.args = args;
    }

    public Object getErrorData() {
        return this.errorData;
    }

    public BizException setErrorData(Object errorData) {
        this.errorData = errorData;
        return this;
    }
}
